package com.hytc.mymall.pager;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hytc.mymall.R;
import com.hytc.mymall.base.BasePager;
import com.hytc.mymall.bean.HomeInfoBean;

/**
 * Created by Administrator on 2016/12/1.
 */

public class pager7 extends BasePager
{
    private ImageView iv_refresh;
    private LinearLayout ll_refresh;
    private TextView tv_refresh;
    private TextView tv_rewardtotal;
    private TextView tv_tjjl;
    private TextView tv_zcjl;

    public pager7(final Context context, final int n, final HomeInfoBean.HomeInfo homeInfo) {
        super(context, n, homeInfo);
    }

    private void loadData(final boolean b) {
//        OkHttpClientManager.getAsyn("http://www.51ydgy.com/appcommon/regReward", new StringPopCallBack(this.context, false) {
//            @Override
//            public void onResponse(final String s) {
//                try {
//                    final JSONArray jsonArray = new JSONArray(s);
//                    final TextView access$1 = tv_rewardtotal;
//                    String string;
//                    if (TextUtils.isEmpty((CharSequence)jsonArray.getString(0))) {
//                        string = "0";
//                    }
//                    else {
//                        string = jsonArray.getString(0);
//                    }
//                    access$1.setText((CharSequence)string);
//                    final TextView access$2 = tv_zcjl;
//                    String string2;
//                    if (TextUtils.isEmpty((CharSequence)jsonArray.getString(0))) {
//                        string2 = "0";
//                    }
//                    else {
//                        string2 = jsonArray.getString(1);
//                    }
//                    access$2.setText((CharSequence)string2);
//                    final TextView access$3 = tv_tjjl;
//                    String string3;
//                    if (TextUtils.isEmpty((CharSequence)jsonArray.getString(0))) {
//                        string3 = "0";
//                    }
//                    else {
//                        string3 = jsonArray.getString(2);
//                    }
//                    access$3.setText((CharSequence)string3);
//                    int imageResource;
//                    String text;
//                    if (b) {
//                        imageResource = R.drawable.ic_launcher;
//                        text = pager7.this.context.getString(R.string.wangergou);
//                    }
//                    else {
//                        imageResource = R.drawable.ic_launcher;
//                        text = pager7.this.context.getString(R.string.wangergou);
//                    }
//                    pager7.this.iv_refresh.setImageResource(imageResource);
//                    pager7.this.tv_refresh.setText((CharSequence)text);
//                }
//                catch (JSONException ex) {
//                    ex.printStackTrace();
//                }
//            }
//        });
    }

    @Override
    public void initData() {
        super.initData();
        this.loadData(false);
    }

    @Override
    public void initView() {
        super.initView();
        this.tv_rewardtotal = (TextView)this.rootView.findViewById(R.id.tv_page7_rewardtotal);
        this.tv_zcjl = (TextView)this.rootView.findViewById(R.id.tv_page7_zcjl);
        this.tv_tjjl = (TextView)this.rootView.findViewById(R.id.tv_page1_tjjl);
        this.iv_refresh = (ImageView)this.rootView.findViewById(R.id.iv_pager7_refresh);
        this.tv_refresh = (TextView)this.rootView.findViewById(R.id.tv_pager7_refresh);
        (this.ll_refresh = (LinearLayout)this.rootView.findViewById(R.id.ll_pager7_refresh)).setOnClickListener((View.OnClickListener)new View.OnClickListener() {
            public void onClick(final View view) {
                pager7.this.loadData(true);
            }
        });
    }
}

